
package com.runa.rccprotocol.dto.furuisi;

import com.runa.protocol.dto.IResponseData;
import com.runa.rccprotocol.dto.ConcentratorRequestData;

public class FuRuiSiRequestData extends ConcentratorRequestData {

    public FuRuiSiRequestData(String address) {
        super(address);
    }

    private byte[] requestData;

    public void readValve(String serial, Integer index) {
        this.requestData = (serial+",frs,frs," + index + ",getvalve").getBytes();
        setHaveResult(true);
    }

    public void setValveOpen(String serial, Integer index, Integer opening) {
        opening = opening * 10;
        this.requestData = (serial+",frs,frs," + index + ",setvalve," + opening).getBytes();
        setHaveResult(true);
    }

    @Override
    public boolean check(IResponseData data) {
        return true;
    }

    @Override
    public byte[] getData() {
        return this.requestData;
    }

}
